package com.zone.mybatis.session;

import com.zone.mybatis.builder.xml.XmlConfigBuild;
import com.zone.mybatis.session.defaults.DefaultSqlSessionFactory;

import java.io.InputStream;

/**
 * @author: zongzi
 * @description: TODO
 * @date: 2023/12/17
 */
public class SqlSessionFactoryBuilder {


    public SqlSessionFactory build(InputStream inputStream) {
        XmlConfigBuild parser = new XmlConfigBuild();
        return this.build(parser.parse(inputStream));
    }

    public SqlSessionFactory build(Configuration configuration) {
        return new DefaultSqlSessionFactory(configuration);
    }
}
